package com.xhs.main.service.xsb.impl;

import com.xhs.main.dao.xsb.XsbContractDao;
import com.xhs.main.entity.xsb.Contract;
import com.xhs.main.service.xsb.XsbContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author hjr
 * @create 2020-10-16-上午 9:57
 */
@Service
public class XsbContractServiceImpl implements XsbContractService {

    @Autowired
    XsbContractDao xsbContractDao;

    @Override
    public void addContract(Contract contract) {
        xsbContractDao.insertContract(contract);

    }

    @Override
    public List<Contract> getAllContract() {
        List<Contract> contracts = xsbContractDao.selectAllContract();
        return contracts;
    }

    @Override
    public List<Contract> getContractByVague(Contract contract) {
        List<Contract> contracts = xsbContractDao.selectAllContractByVague(contract);
        return contracts;
    }

    @Override
    public List<Contract> updateContract(Contract contract) {
        xsbContractDao.updateContract(contract);
        List<Contract> contracts = xsbContractDao.selectAllContract();
        return contracts;
    }
}
